#pragma once
#include <string>
#include "Types.h"

class Position
{
public:
	Position();
	Position(const Position& p);
	Position* operator=(const Position& p);
	Position(const std::string& fen, bool isChess960, int count);
	~Position();

	bool turn;
	Piece board[64];             // [square]
	int startPosPly;
	//StateInfo st;

	int lastEnPassant;
	bool whiteCanCastleKingSide;
	bool whiteCanCastleQueenSide;
	bool blackCanCastleKingSide;
	bool blackCanCastleQueenSide;
	
	void print(/*Move Move*/) const;
	void from_fen(const std::string& fen, bool isChess960);
	void SetFromFEN(const std::string& fen);
	void flip_me();
	//Piece piece_moved(Move m) const;
	bool square_is_empty(Square s) const;
	void Clear();
	bool move_is_legal(const Move m) const;
	void Play(Move move);
	void Unplay(Move Move);
	void movePiece(int sq1,int sq2);
	void undo_Move(Move m);
	bool IsPlayer(int square);
	bool IsEmptyOrOpponent(int square);
	bool IsEmptyOrColor(int square, bool color);
	Piece GetPiece(int square);
	bool IsPieceWhite(int square);
	bool IsPieceBlack(int square);
	bool IsEmpty(int square);
	void SetPiece(Piece piece, int square);

	//bool is_chess960() const;
	//bool chess960;

};


